package com.citycloud.ccuap.tc.admin.entity;

import com.citycloud.ccuap.framework.service.Model;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mybatis.annotations.*;
import org.springframework.data.repository.query.parser.Part;

import java.util.Date;

import static org.springframework.data.mybatis.annotations.Id.GenerationType.AUTO;

/**
 * 授权日志实体对象
 * @author sufeng
 *
 */
@Data
@NoArgsConstructor
@Entity(table = "sys_auth_log")
public class SysAuthLog implements Model {
	private static final long serialVersionUID = 1L;
	
	@Column(name = "project_id")
	@Condition
	private Long projectId;
	
	@Column(name = "project_name")
	@Condition
	private String projectName;
	
	@Id(strategy = AUTO)
	@Column(name = "log_id")
	@Condition
	private Long logId;
	
	@Column(name = "user_no")
	@Condition(type = Part.Type.LIKE)
	private String userNo;
	
	@Column(name = "user_name")
	@Condition(type = Part.Type.LIKE)
	private String userName;
	
	@Column(name = "user_full_path")
	@Condition(type = Part.Type.LIKE)
	private String userFullPath;
	
	@Column(name = "group_no")
	@Condition
	private String groupNo;
	
	@Column(name = "group_name")
	@Condition
	private String groupName;
	
	@Column(name = "ip")
	@Condition(type = Part.Type.LIKE)
	private String ip;
	
	@Column(name = "log_msg")
	@Condition(type = Part.Type.LIKE)
	private String logMsg;
	
	@Column(name = "role_no")
	@Condition(type = Part.Type.LIKE)
	private String roleNo;
	
	@Column(name = "role_name")
	@Condition(type = Part.Type.LIKE)
	private String roleName;
	
	@Column(name = "biz_data")
	@Condition(type = Part.Type.LIKE)
	private String bizData;
	
	@Column(name = "action_time")
	@Conditions({ 
		@Condition,
		@Condition(type = Part.Type.GREATER_THAN_EQUAL, properties="startActionTime"), 
		@Condition(type = Part.Type.LESS_THAN, properties="endActionTime") 
	})
	private Date actionTime;

}